package com.shiguiwu.springmybatis.designpattern.visitor.impl;

import com.shiguiwu.springmybatis.designpattern.visitor.User;
import com.shiguiwu.springmybatis.designpattern.visitor.Visitor;

import java.math.BigDecimal;

/**
 * @description: 老师类
 * @author: stone
 * @date: Created by 2021/10/29 16:26
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.designpattern.visitor.impl
 */
public class Teacher extends User {


    public Teacher(String name, String identity, String clazz) {
        super(name, identity, clazz);
    }

    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }

    //升本率
    public double entranceRatio() {
        return BigDecimal.valueOf(Math.random() * 100).setScale(2,
                BigDecimal.ROUND_HALF_UP).doubleValue();
    }
}
